// https://service-ase3oocp-1302839645.sh.apigw.tencentcs.com/api/room/room/getRoomList?pageNo=1&pageSize=3
import {http} from '../utils/http'
import IndexedDB from '../utils/indexedDB'
let airbnbDB = new IndexedDB('airbnb')
import {IResultOr as IResult} from './interface'
// import airbnb from '../db'
//Mock接口
export async function fetchElephant(){
    await airbnbDB.openStore({elephant:{keyPath:'id',indexs:['nose','ear']}})//不加promise的话 await不起效果
    const result = await airbnbDB.getList('elephant').then(res=>{
        return {code:'000000',message:'操作成功',result:res,success:true}
    })
    return result
}
// export async function fetchElephant() {
//     await airbnb.airbnbDB.openStore({ elephant: { keyPath: 'id', indexs: ['nose', 'ear'] } })
//     const result = await airbnb.airbnbDB.getList('elephant').then(res => {
//         return { code: '000000', message: '操作成功', result: res, success: true }
//     })
//     return result
// }
